using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace LogAnalyzerIIS.Helpers
{
	public class FileHelper
	{
		public static void SaveListBoxToFile(ListBox listBox, string outPath)
		{
			// create a writer and open the file
			TextWriter tw = new StreamWriter(outPath);

			foreach (Object o in listBox.Items)
				// write a line of text to the file
				tw.WriteLine(o.ToString());

			// close the stream
			tw.Close();
		}
	}
}
